using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.ADF.BaseClasses;

namespace CanSWAT
{
    /// <summary>
    /// Summary description for CanSWATToolbar.
    /// </summary>
    [Guid("c4cac59b-dade-4c51-b1c1-9cd2f1ee0aec")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("CanSWAT.CanSWATToolbar")]
    public sealed class CanSWATToolbar : BaseToolbar
    {
        #region COM Registration Function(s)
        [ComRegisterFunction()]
        [ComVisible(false)]
        static void RegisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryRegistration(registerType);

            //
            // TODO: Add any COM registration code here
            //
        }

        [ComUnregisterFunction()]
        [ComVisible(false)]
        static void UnregisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryUnregistration(registerType);

            //
            // TODO: Add any COM unregistration code here
            //
        }

        #region ArcGIS Component Category Registrar generated code
        /// <summary>
        /// Required method for ArcGIS Component Category registration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryRegistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            MxCommandBars.Register(regKey);
        }
        /// <summary>
        /// Required method for ArcGIS Component Category unregistration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryUnregistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            MxCommandBars.Unregister(regKey);
        }

        #endregion
        #endregion

        public CanSWATToolbar()
        {
            //
            // TODO: Define your toolbar here by adding items
            //
            AddItem("{f77cac5a-3a9e-4b41-a050-913934bbc948}"); //generate canswat input files
            AddItem("{59482760-32b9-4e5f-b534-3944e7c6b128}"); //soil data
            AddItem("{8325384e-215e-49ec-bb6a-e2df8d721892}"); //result analysis
        }

        public override string Caption
        {
            get
            {
                //TODO: Replace bar caption
                return "CanSWAT Toolbar";
            }
        }
        public override string Name
        {
            get
            {
                //TODO: Replace bar ID
                return "CanSWATToolbar";
            }
        }
    }
}